package com.epam.springtest.domain;

import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.Size;

/**
 * @author Mikalai Kisel
 */

public class User {

    private final int nameMinSize = 0;
    private final int nameMaxSize = 99;
    private final int emailMinSize = 0;
    private final int emailMaxSize = 199;
    private final int passwordMinSize = 4;
    private final int passwordMaxSize = 29;

    private String name;
    private String password;
    private String email;

    @NotEmpty(message="{validation.name.NotEmpty.message}")
    @Size(min=nameMinSize, max=nameMaxSize, message="{validation.name.Size.message}")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

//    @NotEmpty(message="{validation.password.NotEmpty.message}")
    @Size(min=passwordMinSize, max=passwordMaxSize, message="{validation.password.Size.message}")
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @NotEmpty(message="{validation.email.NotEmpty.message}")
    @Size(min=emailMinSize, max=emailMaxSize, message="{validation.email.Size.message}")
    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    @Override
    public String toString() {
        return "User{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                '}';
    }
}
